0 DIM DUPL$(20),PRO$(9),LIBFILE$(10),MUNIQUE(500),NUNIQUE(500),INF$(112):DIM B$(10),A$(14),BIT(15):VERSION$="2.0":DOT$=".":GOTO 20010:! COMPARE TWO LIBRARY FILES
1030 GOSUB 1110:LOCATE 19,1:IF EXPERT THEN PRINT "Expert mode : Type a number to make your choice "
1038 IF EXPERT<>1 THEN LOCATE 19,1:PRINT"Beginner's mode: Type a number to light up your choice then press enter."
1040 COLOR 7,0:CM$="":WHILE CM$="":CM$=INKEY$:WEND:IF ASC(CM$)=27 THEN CHOICE=69:RETURN
1065 CM=ASC(CM$) - ASC("0"):IF CM>=0 AND CM<=NC THEN CHOICE=CM
1070 IF (CHOICE<>0) THEN GOTO 1099
1080 EXPERT=1-EXPERT:GOTO 1030
1099 IF (EXPERT OR CM$=CHR$(13)) AND (CHOICE>=0) THEN RETURN ELSE 1030
1110 LONGEST=0:FOR I=1 TO NC:IF LEN(PRO$(I))>LONGEST THEN LONGEST=LEN(PRO$(I))
1120 NEXT I:XP=(SCWD/2-2)-LONGEST/2:LOCATE 6,XP:PRINT "0. ";:LOCATE 6,XP+3:IF EXPERT=0 THEN PRINT"Change to expert mode ";
1130 IF EXPERT=1 THEN PRINT "Change to beginner's mode"
1135 FOR I=1 TO NC:LOCATE 6+I,XP:IF CHOICE=I THEN COLOR 31,0 ELSE COLOR 7,0
1199 PRINT CHR$(48+I);". ";PRO$(I):NEXT I:COLOR 7,0:RETURN:IF N<=0 OR N>1000 THEN N=5
1415 NN=N*10:SOUND 32700,NN:SOUND 32700,2:RETURN
1510 CLS:IF QUIET THEN RETURN ELSE COLOR 0,7:PRINT
1515 LOCATE 1,1:PRINT " "+PROGNAME$;TAB(SCWD-15);"Date:";DATE$:LOCATE 2,1:PRINT"Store library file on drive ";DRLIB$;" Read disks in drive ";DRCAT$:LOCATE 2,SCWD-15:PRINT"Time: ";TIME$:PRINT:COLOR 7,0:RETURN
1900 '
1910 LOCATE 22,15:PRINT"Press any key to continue":V$=INKEY$:IF V$="" THEN GOTO 1910
1999 RETURN
2010 ER=ERR:EL=ERL:IF(ERR<>52) AND (ERR<>64) THEN 2012 ELSE LOCATE 24,1:PRINT"Invalid file name";:FOR I=1 TO 2000:NEXT I:LOCATE 24,1:PRINT SPACE$(80):RESUME
2012 IF(ERR<>58 AND ERL<>19010) THEN 2013 ELSE RESUME 19011
2013 IF(ERR<>53 AND ERL<>19010) THEN 2015 ELSE RESUME 19012
2015 IF ERR<>53 THEN 2020 ELSE LOCATE 24,1:PRINT"Do you have the right disk in the drive and the correct file name?";:FOR I=1 TO 2000:NEXT I:LOCATE 24,1:PRINT SPACE$(80):RESUME
2020 IF ERR<>61 THEN 2025 ELSE LOCATE 23,1:PRINT"The disk appears to be full."
2021 IF EL=5240 THEN PRINT"Please insert a non-full disk in the drive and press ENTER":INPUT AA$:CLS:RESUME 5210
2022 PRINT"You should start cataloging from the beginning on a fresh diskette":FOR I=1 TO 1000:NEXT I:END
2025 IF ERR<>70 THEN 2030 ELSE LOCATE 24,1:PRINT"The disk is write-protected. Please insert the correct diskette.":FOR I=1 TO 2000:NEXT I:LOCATE 24,1:PRINT SPACE$(80):RESUME
2030 IF ERR<>71 THEN 2040 ELSE LOCATE 22,1:PRINT"Check the drives to be sure the door is closed and a diskette is inside.":PRINT"Press ENTER to continue.";:INPUT AA$:LOCATE 22,1:PRINT SPACE$(75):PRINT SPACE$(75)
2031 IF EL=5220 THEN RESUME 5220 ELSE RESUME 6530
2040 PRINT"ERR=";ERR;" ERL=";EL:END:RETURN
2310 CLS:LOCATE 2,40:PRINT"PC-LIB":LOCATE 4,25:PRINT"Copyright(c) 1983 by John Dannenfeldt":LOCATE 5,39:PRINT"Version ";VERSION$
2325 LOCATE 10,15:PRINT"If you are using this program and find it to be of value,":LOCATE 11,15:PRINT"suggestions would be appreciated.":LOCATE 14,35:PRINT"John C. Dannenfeldt":LOCATE 15,35:PRINT"1240 10th Street":LOCATE 16,35:PRINT"Silvis, IL 61282"
2345 LOCATE 21,15:PRINT"You are encouraged to copy and share this program with others.":LOCATE 18,15:PRINT"The latest version will always be available on the QCPC BBS":LOCATE 19,15:PRINT"at 1-319-332-7648 or 1-309-796-2214":GOSUB 19010:GOSUB 1900:RETURN
5010 FI$=DRLIB$+":"+"***.dta":SCREEN,,0,0:GOSUB 1510:PRINT" Current library files are:":SCR$="":I=1:LOCATE 6,1:FILES FI$:GOSUB 1910:RETURN
5220 OPEN LFD$+".HDR" FOR OUTPUT AS #1:PRINT #1,S$:CLOSE:RETURN
6110 OP=0:R%=1:GOSUB 1510:LOCATE 4,1:PRINT SPACE$(30)+"CREATE NEW LIBRARY FILE":PRINT:PRINT"You will be asked to insert each disk once for cataloging.":PRINT"Please be sure to only catalog the disks you want in this library file!"
6130 LOCATE 10,5:INPUT"What name would you like to give this library file";LFD$:IF LEN(LFD$)>8 OR LEN(LFD$)<1 OR LFD$="" THEN GOTO 6130
6345 BIT(0)=(FDATE AND 1)/1:BIT(1)=(FDATE AND 2)/2:BIT(2)=(FDATE AND 4)/4:BIT(3)=(FDATE AND 8)/8:BIT(4)=(FDATE AND 16)/16:BIT(5)=(FDATE AND 32)/32:BIT(6)=(FDATE AND 64)/64:BIT(7)=(FDATE AND 128)/128:BIT(8)=(FDATE AND 256)/256
6346 BIT(9)=(FDATE AND 512)/512:BIT(10)=(FDATE AND 1024)/1024:BIT(11)=(FDATE AND 2048)/2048:BIT(12)=(FDATE AND 4096)/4096:BIT(13)=(FDATE AND 8192)/8192:BIT(14)=(FDATE AND 16384)/16384:BIT(15)=0
6390 CLOSE:FP$=FIDTA$:PRINT"Is ";VOL$;" the correct volume name for this disk";:INPUT;ANS$:IF((LEFT$(ANS$,1)="Y") OR (LEFT$(ANS$,1)="y")) THEN GOTO 6395
6393 PRINT:INPUT"Type in a volume name- 6 characters please";VOL$:IF VOL$="" THEN GOTO 6393
6395 FOR I=1 TO N-1:I$=INF$(I)+SPACE$(30)+VOL$+CHR$(13):GOSUB 6510:R%=R%+1:NEXT I:RETURN
6510 IF O2=1 THEN GOTO 6520
6515 OPEN FP$ AS #2 LEN=62:O2=1
6520 FIELD #2,62 AS DT$:LSET DT$=I$:PUT #2,R%:RETURN
6610 DU=0:STRI$=NME$+"."+EXT$:FOR Q=1 TO ND:IF (LEFT$(STRI$,LEN(DUPL$(Q)))=DUPL$(Q)) THEN DU=1
6629 NEXT Q:RETURN
6710 CLOSE:OPEN FIDTA$ AS #1 LEN=62:FIELD #1,1 AS F$,59 AS D$:FA$=CHR$(92):DA$=SPACE$(61):LSET F$=FA$:LSET D$=DA$:PUT #1,R%:CLOSE:RETURN
6810 GOSUB 1510:LOCATE 5,1:PRINT"Since some files like IBMDOS.COM are on many or most disks,":PRINT"we allow you to define 20 file names that you don't really care to catalog.":ND=6:PRINT"The current duplicate file names are:"
6820 FOR Q=1 TO 10:LOCATE 8+Q,10:PRINT DUPL$(Q) TAB(30) DUPL$(Q+10):NEXT Q:PRINT"Would you like to add to the list";:INPUT AN$:IF LEFT$(AN$,1)="Y" OR LEFT$(AN$,1)="y" THEN GOTO 6835
6831 RETURN
6835 LOCATE 20,10:INPUT"Additional file name";DUPL$(ND+1):LOCATE 21,10:INPUT"More additions?";AN$:ND=ND+1:IF AN$="y" OR AN$="Y" THEN 6845 ELSE GOTO 6899
6910 GOSUB 1510:OLIB$=DRLIB$:OCAT$=DRCAT$:INPUT "Do you want to change the drive functions noted above";AN$:IF LEFT$(AN$,1)="Y" OR LEFT$(AN$,1)="y" THEN 6925 ELSE RETURN
6925 PRINT:INPUT"Store library file on drive ";DRLIB$:IF DRLIB$="" THEN 6925
6930 PRINT:INPUT"Read disks in drive ";DRCAT$:IF DRCAT$="" THEN 6930
6935 IF DRLIB$=DRCAT$ THEN PRINT "You can't do both in one drive! Try again!":GOTO 6955 ELSE 6936
6936 UPLIB$=CHR$(ASC(DRLIB$)-32):UPCAT$=CHR$(ASC(DRCAT$)-32):IF (ASC(DRLIB$)>96) THEN DRLIB$=UPLIB$
6939 IF (ASC(DRCAT$)>96) THEN DRCAT$=UPCAT$
6950 IF((LEN(DRLIB$)<>1) OR(LEN(DRCAT$)<>1)) THEN 6955
6951 LIBA=ASC(DRLIB$):CATA=ASC(DRCAT$):IF((LIBA<65) OR (CATA<65)) THEN LOCATE 22,1:PRINT"Please use rational drive letters only!!":GOTO 6955
7015 PRINT"PURPOSE--":PRINT"This program allows you to create a diskfile of all your programs":PRINT"by reading the directory off each disk you catalog, assigning a volume name":PRINT"and writing it to a file that may be manipulated by PC-FILE-- a"
7017 PRINT"public domain database program available from Jim Button"
7019 PRINT:PRINT"DEFAULT FILE NAMES--":PRINT"Since some file names like IBMDOS.COM are on":PRINT"many or most disks, we allow you to define 20 file names":PRINT"that you don't really care to catalog."
7020 PRINT:PRINT"After you create your library file you must use PC-FILE to sort":PRINT"it before PC-FILE can produce reports on your disk library.":PRINT:PRINT"Remember to start BASIC/S:1024 so there is enough buffer space!!":GOSUB 1910:RETURN
11010 O1=0:O2=0:O3=0:O4=0:GOTO 11240:GOSUB 1510
11030 '
11035 IF O1=1 THEN GOTO 11045
11040 OPEN FG$ AS #1 LEN=26:O1=1
11045 IF EOF(1) THEN MDONE=1:GOTO 11055
11050 FIELD #1,2 AS MINAME$,20 AS REST$,4 AS MD$:GET #1,R%:MD=VAL(MD$)
11055 RETURN
11060 '
11065 IF O2=1 THEN GOTO 11075
11070 OPEN FG$ AS #2 LEN=26:O2=1
11075 IF EOF(2) THEN NDONE=1:GOTO 11085
11080 FIELD #2,2 AS NINAME$,20 AS REST$,4 AS ND$:GET #2,R%:ND=VAL(ND$)
11085 RETURN
11090 '
11095 IF O3=1 THEN GOTO 11105
11100 OPEN FG$ AS #3 LEN=62:O3=1
11105 FIELD #3,11 AS MNAME$,51 AS MREST$:GET #3,R%:RETURN
11110 '
11115 IF O4=1 THEN GOTO 11125
11120 OPEN FG$ AS #4 LEN=62:O4=1
11125 FIELD #4,11 AS NNAME$,51 AS NREST$:GET #4,R%:RETURN
11150 '
11155 IF O1=1 THEN GOTO 11165
11160 OPEN FG$ AS #1 LEN=62:O1=1
11165 FIELD #1,62 AS DTA$:GET #1,R%:RETURN
11190 '
11195 GOSUB 1510:LOCATE 4,1:PRINT"This program will compare any two library files CAT1.DTA and CAT2.DTA":PRINT"created by this version of PC-LIB"
11200 PRINT:PRINT"It is suggested that you operate this program from electronic disk since":PRINT"it does a great deal of disk reading and writing and will run faster and":PRINT"cause less disk wear on an electronic disk."
11205 PRINT:PRINT"The disk (electronic or real) should contain these programs:":PRINT" CAT1.DTA":PRINT" CAT1.INX":PRINT" CAT2.DTA":PRINT" CAT2.INX":PRINT" BASIC.COM"
11210 PRINT" and this program- PC-LIB.BAS":PRINT:PRINT"These programs will take up about 100K of space so a 128K or 196K ":PRINT"electronic disk is suggested to allow adequate room for the resulting files":GOSUB 1910
11215 GOSUB 1510:PRINT"This program will create on the disk the program runs from two sets of PC-LIB":PRINT"formatted files:":PRINT:PRINT"UNIQUE1.DTA contains all the entries found only in the CAT1.DTA":PRINT"file on comparison."
11220 PRINT:PRINT"UNIQUE2.DTA contains all the programs found only in CAT2.DTA":PRINT:PRINT"You will need the accompanying header files CAT1.HDR and CAT2.HDR":PRINT"when you use PC-FILE to examine CAT1.DTA and CAT2.DTA":GOSUB 1910
11225 GOSUB 1510:PRINT"For your convenience, below is a BAT file listing that can be used to load":PRINT"the electronic disk with the necessary programs and start the program":PRINT"Please note the parameters needed when you use BASIC"
11230 PRINT:PRINT"It assumes that you use CAT1.DTA and CAT2.DTA as the names for your library files":PRINT"and that you use C: as your electronic disk":PRINT
11290 LOCATE 5,1:PRINT"What is the name of the library file to be compared with ";CAT1DTA$;:INPUT;CAT2$:X=INSTR(CAT2$,"."):IF X<>0 THEN GOTO 11305
11295 IF LEN(CAT2$)>8 THEN GOTO 11290
11300 CAT2ROOT$=CAT2$:GOTO 11310
11305 CAT2ROOT$=LEFT$(CAT2$,X-1)
11310 CAT2INX$=CAT2ROOT$+".inx":CAT2DTA$=CAT2ROOT$+".dta":PRINT:PRINT"Would you like a file of all programs unique to ";CAT1DTA$;:INPUT;UN1$:PRINT:PRINT"Would you like a file of all programs unique to ";CAT2DTA$;:INPUT;UN2$
11315 PRINT:PRINT"Would you like to annotate ";CAT2DTA$;" with the descriptions from ";CAT1DTA$;:INPUT;ANNO$:GOSUB 1510:LOCATE 3,1:PRINT"To compare library files they must be sorted correctly first.":PRINT"the correct sort order is:":PRINT" Name"
11317 PRINT"Ext":INPUT"Is the new file sorted in this order";ANS$:A$=LEFT$(ANS$,1):IF A$<>"n" OR A$<>"N" THEN GOTO 11330
11325 PRINT"Sort ";NEWROOT$;" correctly using PC-FILE and then run this program again":END
11415 CLOSE:O1=0:O2=0:O3=0:O4=0:IF ((UN1$<>"Y") AND (UN1$<>"y")) THEN GOTO 11425
11420 FG$=CAT1DTA$:FP$="unique1.dta":CLS:PRINT"Programs unique to ";CAT1DTA$:FOR N=1 TO MU-1:R%=MUNIQUE(N):GOSUB 11150:I$=DTA$:PRINT"M UNIQUE(";N;")= ";DTA$:R%=N:GOSUB 6510:NEXT N:R%=MU:I$="\"+SPACE$(61):GOSUB 6510:CLOSE:O1=0:O2=0
11425 ' create nunique
11427 GOSUB 1910:IF ((UN2$<>"Y") AND (UN2$<>"y")) THEN GOTO 11440
11435 FG$=CAT2DTA$:FP$="unique2.dta":CLS:PRINT"Programs unique to ";CAT2DTA$:FOR N=1 TO NU-1:R%=NUNIQUE(N):GOSUB 11150:I$=DTA$:PRINT"N UNIQUE(";N;")= ";DTA$:R%=N:GOSUB 6510:NEXT N:R%=NU:I$="\"+SPACE$(61):GOSUB 6510
11440 GOSUB 1910:CLOSE:RETURN
19010 NAME "FATREAD.BIN" AS "FATREAD.BIN"
19011 DEF SEG=&H2100:BLOAD"FATREAD.BIN",0:RETURN
19012 OPEN "R",#1,"FATREAD.BIN",1:FIELD #1,1 AS N$:READ N:LL=(N/28)+1:FOR I=1 TO N:READ X$,CHECK:FOR C=1 TO LEN(X$) STEP 2:CC$="&H"+MID$(X$,C,2):IF CHECK=9999 THEN 19024
19020 LSET N$=CHR$(VAL(CC$)):PUT #1:CHECK=CHECK-VAL(CC$):NEXT C:IF CHECK<>0 THEN 19052
19022 NEXT I:CLOSE
19024 GOTO 19056
19026 DATA 292
19028 DATA FD001700001C012401EB3590EB6490FF00000000003F000000000000,1571
19030 DATA 00000000000000000000000000000000000000000000000000000000,0
19032 DATA 0000000000000000558BEC1E8CC88ED833F6268B5E06268B5F01268A,2211
19034 DATA 00888410004683FE0B7CF38B7608268B04A20F0032C0A238001F5DCA,2526
19036 DATA 0400558BEC1E8CC88ED8FA892636008C1634008ED0BCCC01FBBA1D01,3095
19038 DATA B41ACD21BA0800803E3800007508FE023800B411EB02B412CD213C00,2255
19040 DATA 7560268B5E0826803F0E7551268B5F0133FF8BF78BCFB06002062401,2561
19042 DATA 2688014726C6013A478A8425013C20740626880147EB0C80F9007507,2128
19044 DATA FEC126C6012E474683FE08750C80F9007507FEC126C6012E4783FE0B,3091
19046 DATA 7CCFA0300132E4EB03B8FFFFEB03B8FEFF268B5E06268907FA8E1634,3606
19048 DATA 008B263600FB1F5DCA04001A,838
19050 DATA 000000,9999
19052 PRINT "* * ERROR VERIFY FOLLOWING DATA * * * ":PRINT X$;",";CHECK
20010 DUPL$(1)="BASIC.COM":DUPL$(2)="BASICA.COM":DUPL$(3)="COMMAND.COM":DUPL$(4)="IBMBIO.COM":DUPL$(5)="IBMDOS.COM":DUPL$(6)="SD.COM":ND=6:FAT=0:DRLIB$="B":DRCAT$="A":DEF SEG=0:POKE &H417,PEEK(&H417) OR &H40:ON ERROR GOTO 2010:SCREEN 0:KEY OFF
21017 GOSUB 2310:SCWD=80:PROGNAME$=" PC-LIB Multidisk Librarian":EXPERT=0:NC=7:TITLE$="Main Menu":PRO$(1)="Create new library file":PRO$(2)="Display current library files":PRO$(3)="Redefine duplicate file list":PRO$(4)="Change default drives"
21050 PRO$(5)="Leave this program":PRO$(6)="Program instructions":PRO$(7)="Compare two library files and annotate"
21055 GOSUB 1010:IF CHOICE=1 THEN GOSUB 6110
21065 IF CHOICE=2 THEN GOSUB 5010
21070 IF CHOICE=3 THEN GOSUB 6810
21075 IF CHOICE=4 THEN GOSUB 6910
21080 IF CHOICE=5 THEN 30000
21083 IF CHOICE=6 THEN GOSUB 7010
21084 IF CHOICE=7 THEN GOSUB 11010
21085 GOTO 21055
30000 CLS:GOSUB 1510:LOCATE 10,1:PRINT"Remember to sort your new disk library file:";LFNA$:LOCATE 11,1:PRINT"before using any other PC-File features":GOSUB 1910:END